package com.beadwallet.alarm.web;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.beadwallet.alarm.entity.sender.Sender;
import com.beadwallet.alarm.service.sender.ISenderService;
import com.beadwallet.alarm.util.IdCardGetAgeSexUtil;
import com.beadwallet.common.aspect.WebLog;
import com.beadwallet.common.controller.BaseController;
import com.beadwallet.common.enums.CodeEnum;
import com.beadwallet.common.utils.HttpUtil;
import com.beadwallet.common.utils.MD5;
import com.beadwallet.common.utils.RestTemplateUtil;
import com.netflix.ribbon.proxy.annotation.Http;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author master
 * @since 2017-12-15
 */
@RestController
@RequestMapping("/alarm/sender")
@Api(value = "alarm", description = "警报系统", tags = "alarm")
public class SenderController extends BaseController {
    @Autowired
    private ISenderService iSenderService;

    @Autowired
    private RestTemplateUtil restTemplateUtil;

    @WebLog(description = "查询所有")
    @PostMapping("/queryAll")
    @ResponseBody
    public String queryAllSenders() {
        Wrapper<Sender> wrapper = new EntityWrapper<>();
        List<Sender> senders = iSenderService.selectList(wrapper);
        return respJson(CodeEnum.SUCC, senders);
    }
}
